package com.cyys.modules.core.sysParam;

import com.cyys.common.redis.RedisUtil;
import com.cyys.modules.generator.model.GeneratorConfigure;
import com.cyys.modules.generator.service.GeneratorConfigureService;

public class GeneratorUtil {
    public static void init(GeneratorConfigureService generatorConfigureService) {
        RedisUtil.delete(RedisConstants.GENERATOR_CONFIGURE);
        RedisUtil.set(RedisConstants.GENERATOR_CONFIGURE,generatorConfigureService.getById("1"));
    }

    public static GeneratorConfigure get() {
        return (GeneratorConfigure)RedisUtil.get(RedisConstants.GENERATOR_CONFIGURE);
    }

    public static void modify(GeneratorConfigure entity) {
        RedisUtil.delete(RedisConstants.GENERATOR_CONFIGURE);
        RedisUtil.set(RedisConstants.GENERATOR_CONFIGURE,entity);
    }
}
